1. Field of the Invention
The present invention relates to apparatus and method for image processing, and a computer readable recording medium in which an image processing program is recorded. More particularly, the present invention relates to an image processing apparatus, an image processing method, and a computer readable recording medium recording an image processing program for processing an image obtained by picking up or reading an original.
2. Description of the Related Art
Conventionally, a non-contact type image pickup device like a digital camera and a contact type input device like an image scanner have been used to convert an original having an image formed on a paper or the like to digital data. Once an original paper is folded, a fold line or a fold may remain thereon. When shooting such an original including the fold with a digital camera or reading it with an image scanner, the amount of reflected light would differ in the folded portion from the remaining portion due to surface irregularity at the folded portion. As a result, the image obtained by shooting would include noise at the folded portion, with its luminance value varied from that of the remaining portion. Similarly, the image read by the image scanner would include noise at the folded portion.
FIG. 13 shows an original to be shot by a digital camera. The original 200 includes a region 201 having a photograph therein and a region 203 having text therein. Original 200 has been folded and has a fold line 205 remained thereon.
FIG. 14 schematically shows an image obtained by shooting the original shown in FIG. 13 by a digital camera. Referring to FIG. 14, the picked up image 250 includes a region 260 having original 200 expressed therein. Region 260 in turn includes a region 261 corresponding to photo region 201 of original 200, a region 263 corresponding to text region 203, and shade 265 corresponding to a portion around fold line 205 of original 200. Shade 265 appears because of the difference in the amount of reflected light in the folded portion from the remaining portion of original 200 due to the surface irregularity at fold line 205.
When binarizing picked up image 205, an edge originally not existent on original 200 comes to appear, since the lightness is lower in shade 265 than in the remaining portion. This degrades accuracy in a character recognition process or the like following the binarizing process. In the case where image 250 is subjected to a process for extracting a rectangular region enclosing a photograph or the like therein, the accuracy of extraction would also be degraded. FIG. 15 shows a photo region that would be extracted when the photo region extracting process is conducted for the image shown in FIG. 14. Referring to FIG. 15, the portion of shade 265 is misjudged to have an attribute as a picture, so that the rectangular region 267 has been extracted wrongly as the photo region.
Besides the binarizing process, in a process of compressing an image picked up from an original graphic printed with a limited number of colors by indexing the colors, the rate of compression would be degraded due to a considerable increase in the number of colors at a portion within the image corresponding to the fold of the original.
As a technique for correcting the shade appearing on an image obtained from pickup of an original due to a fold on the original, an image reader performing shading correction has been disclosed in Japanese Patent Laying-Open No. 1-165264. This image reader corrects a pixel value based on shading information obtained in advance from pickup of a white plate.
Further, Japanese Patent Laying-Open No. 2-230870 discloses an image reader which detects a background luminance value of an original from an image obtained from pickup thereof, and eliminates the background based on the detected background luminance value.
There is another method for correcting shading by additionally providing a sensor to detect height information of an original and estimating unevenness in illuminance from the detected height of the original. A sensor may be of the type that obtains the height information from a radiated result of spot light or slit light.
These conventional techniques however exhibit various problems. In the image reader disclosed in Japanese Patent Laying-Open No. 1-165264, the white plate is used. Since the white plate does not include a fold at a position corresponding to that of the fold on the original, correction of such a fold cannot be made only with the shading information obtained from the white plate.
With the image reader disclosed in Japanese Patent Laying-Open No. 2-230870, correction cannot be made for an image having almost no background region.
Further, in order to detect a local change in height of the original due to a fold or the like with the method utilizing the height information obtained from a separate sensor, it is necessary to obtain the height information from a large number of positions. This increases the number of pieces of the height information, thereby decreasing the processing speed. In addition, to detect a minute change in height, an expensive sensor will be required or the device size will be increased. There also arises a need for detailed information about lighting conditions including position, direction and intensity of indoor or solar light.